Method and apparatus for performing mapping information management regarding redundant array of independent disks

ABSTRACT

A method and apparatus for performing mapping information management regarding a RAID are provided. The method includes: writing data into a data region of the RAID in a redirect-on-write (ROW) manner, and recording mapping information between logical addresses of the data and protected-access-unit addresses (p-addresses) of protected access units in the data region into a logical-address-to-p-address (L2p) table within a table region of the RAID; when partial data of the data is updated, maintaining an updating list including a set of L2p table entries for the partial data in a RAM, and maintaining a recovery log corresponding to the updating list in a log region of the RAID, for power failure recovery; and according to the updating list, detecting whether a number of same-location L2p table entries in the set of L2p table entries reaches a predetermined threshold, to selectively update the L2p table with the same-location L2p table entries.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention is related to storage systems, and moreparticularly, to a method and apparatus for performing mappinginformation management regarding a redundant array of independent disks(RAID).

2. Description of the Prior Art

A redundant array of independent disks (RAID) may be implemented in aserver. Data therein can obtain a corresponding level of protectionthrough various types of RAID schemes. For example, for the purpose ofdata backup, the server may be designed to have a copy-on-write (COW)architecture. Due to the characteristic(s) of the COW architecture,performance of the server may degrade over time. To prevent thisproblem, the server may be designed to have a redirect-on-write (ROW)architecture. This may result in some problems or side effects, however.Thus, there is a need for a novel method and associated apparatus toguarantee that a storage system is able to correctly operate undervarious conditions.

SUMMARY OF THE INVENTION

An objective of the present invention is to provide a method andapparatus for performing mapping information management regarding aredundant array of independent disks (RAID), to solve the problems ofthe related art.

Another objective of the present invention is to provide a method andapparatus for performing mapping information management regarding aRAID, to guarantee that a storage system is able to correctly operateunder various conditions.

Yet another objective of the present invention is to provide a methodand apparatus for performing mapping information management regarding aRAID, to solve the related art problems without introducing any sideeffect or in a way that is less likely to introduce side effects.

At least one embodiment of the present invention provides a method forperforming mapping information management regarding a RAID. The methodmay comprise: writing data into a data region of the RAID in aredirect-on-write (ROW) manner, and recording mapping informationbetween logical addresses of the data and respectiveprotected-access-unit addresses (p-addresses) of protected access unitsin the data region into a logical-address-to-p-address (L2p) tablewithin a table region of the RAID, wherein subsets of the data arewritten into the protected access units, respectively; in response topartial data of the data being updated, maintaining an updating listcomprising a set of L2p table entries for the partial data in a randomaccess memory (RAM), and maintaining a recovery log corresponding to theupdating list in a log region of the RAID, for power failure recovery;and according to the updating list, detecting whether a number of atleast two same-location L2p table entries in the set of L2p tableentries reaches a predetermined threshold, to selectively update the L2ptable with the aforementioned at least two same-location L2p tableentries, wherein the aforementioned at least two same-location L2p tableentries represent L2P table entries within the set of L2P table entriesthat are supposed to be stored into a same protected access unit withinthe table region.

According to some embodiments, the present invention further provides astorage system operating according to the aforementioned method, whereinthe storage system comprises the RAID.

At least one embodiment of the present invention provides an apparatusfor performing mapping information management regarding a RAID. Theapparatus comprises a processing circuit, where the processing circuitis positioned in a storage system, and is arranged to control operationsof the storage system. The operations of the storage apparatus maycomprise: writing data into a data region of the RAID in a ROW manner,and recording mapping information between logical addresses of the dataand respective p-addresses of protected access units in the data regioninto an L2p table within a table region of the RAID, wherein subsets ofthe data are written into the protected access units, respectively; inresponse to partial data of the data being updated, maintaining anupdating list comprising a set of L2p table entries for the partial datain a RAM, and maintaining a recovery log corresponding to the updatinglist in a log region of the RAID, for power failure recovery; andaccording to the updating list, detecting whether a number of at leasttwo same-location L2p table entries in the set of L2p table entriesreaches a predetermined threshold, to selectively update the L2p tablewith the aforementioned at least two same-location L2p table entries,wherein the aforementioned at least two same-location L2p table entriesrepresent L2P table entries within the set of L2P table entries that aresupposed to be stored into a same protected access unit within the tableregion.

The present invention method and apparatus can guarantee that thestorage system is able to normally operate under various conditions. Inaddition, the present invention method and apparatus provide a powerfulmapping information managing mechanism. Thus, various purposes can beachieved, such as optimal performance, high security and budget control.Additionally, the present invention method and apparatus can solve therelated art problems without introducing any side effect or in a waythat is less likely to introduce side effects.

These and other objectives of the present invention will no doubt becomeobvious to those of ordinary skill in the art after reading thefollowing detailed description of the preferred embodiment that isillustrated in the various figures and drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram illustrating a storage system and a user deviceaccording to an embodiment of the present invention.

FIG. 2 is a flowchart illustrating a method for performing mappinginformation management regarding a RAID (such as that shown in FIG. 1)according to an embodiment of the present invention.

FIG. 3 illustrates a plurality of protected access units involved in themethod shown in FIG. 2 according to an embodiment of the presentinvention, where examples of the plurality of protected access units maybe protected blocks.

FIG. 4 illustrates an L2p table used in the method shown in FIG. 2according to an embodiment of the present invention.

FIG. 5 illustrates an updating list and a recovery log involved in themethod shown in FIG. 2 according to an embodiment of the presentinvention.

FIG. 6 illustrates an updating list and a recovery log involved in themethod shown in FIG. 2 according to another embodiment of the presentinvention.

DETAILED DESCRIPTION

FIG. 1 is a diagram illustrating a storage system 100 and a user device10 according to an embodiment of the present invention. The user device10 may comprise a processing circuit 11 (e.g. at least one processor andassociated circuits), and may further comprise an interface circuit 12and a storage device coupled to the processing circuit 11. The storagesystem 100 may comprise a processing circuit 111 (e.g. at least oneprocessor and associated circuits), and may further comprise interfacecircuits 112 and 122 and random access memory (RAM) 121 coupled to theprocessing circuit 111 through a bus 110, and storage devices {130, 131,132, 133, 134}, such as hard disk drives and/or solid-state drives, maybe installed in the storage system 100 through the interface circuit 122to form a RAID, where a program code 111P executed in the processingcircuit 111 may be read from the storage device 130 (e.g. a systemdisk), and may maintain (e.g. build, store, and/or update) a managementtable 121T within the RAM 121 in order to perform related operations ofthe present invention, to manage a data region DR, a table region TR anda log region LR. Each of the interface circuits 12 and 112 may beimplemented as a wired and/or wireless network interface, to allow thestorage system 100 to exchange information with the user device 10. Auser may access (e.g. read or write) user data in the storage system 100through the user device 10. Examples of the user device 10 may include,but are not limited to: a multifunctional mobile phone, a tablet, awearable device and a personal computer (such as a desktop computer anda laptop computer). Examples of the storage system 100 may include, butare not limited to: a server such as a storage server. According to someembodiments, the architecture of the storage system 100 may vary. Forexample, the program code 111P may be implemented through an exclusivehardware installed in the interface circuit 122, to perform the relatedoperations of the present invention.

FIG. 2 is a flowchart illustrating a method 200 for performing mappinginformation management regarding a RAID (such as the RAID shown inFIG. 1) according to an embodiment of the present invention. The method200 may be applied to the storage system 100, the processing circuit 111that executes the program code 111P, and related components, which areshown in FIG. 1.

In Step 210, the storage system 100 (e.g. the processing circuit 111)writes data into the data region DR of the RAID in a redirect-on-write(ROW) manner, and records mapping information between logical addressesof the data and respective protected-access-unit addresses (p-addresses)of protected access units in the data region DR into alogical-address-to-p-address (L2p) table within the table region TR ofthe RAID, wherein subsets of the data are written into the protectedaccess units, respectively.

In Step 220, when partial data of the data is updated, the storagesystem 100 (e.g. the processing circuit 111) maintains an updating listcomprising a set of L2p table entries for the partial data in the RAM121, and maintains a recovery log corresponding to the updating list inthe log region LR of the RAID, for power failure recovery.

In Step 230, according to the updating list, the storage system 100(e.g. the processing circuit 111) detects whether a number of at leasttwo same-location L2p table entries in the set of L2p table entriesreaches a predetermined threshold (e.g. 2, or any of other predeterminedvalues), to selectively update the L2p table with the aforementioned atleast two same-location L2p table entries, wherein the aforementioned atleast two same-location L2p table entries represent L2P table entrieswithin the set of L2P table entries that are supposed to be stored intoa same protected access unit within the table region TR, such as the L2Ptable entries that are within the set of L2P table entries and should bestored into the same protected access unit within the table region TR.For example, an L2p table entry may be an updated version of a portionof the L2p table, such as that for updating the L2p table, and maycomprise a latest storage location corresponding to a ROW operation.

According to this embodiment, in Step 220, when the partial data of thedata is updated, the storage system 100 (e.g. the processing circuit111) may correspondingly record auxiliary information in the updatinglist in order to detect whether the aforementioned at least twosame-location L2p table entries exist in the set of L2p table entries.For example, the auxiliary information may indicate a set of recoverylog entries within the recovery log, and the set of recovery log entriesmay point toward a set of protected access units within the table regionTR, to guide the L2p table to be updated according to the set of L2ptable entries, but the present invention is not limited thereto.

According to some embodiments, the updating list may comprise a set ofpointers respectively corresponding to the set of L2p table entries, theset of pointers may respectively point toward a set of recovery logentries within the recovery log, and the set of recovery log entries maypoint toward a set of protected access units within the table region TR.For example, the L2p table may comprise at least one sub-table that issupposed to be updated with the set of L2p table entries, such as one ormore sub-tables that should be updated with the set of L2p tableentries, and a location of the aforementioned at least one sub-table inthe table region may correspond to the set of protected access units. Inanother example, the L2p table may comprise at least one sub-table thatis supposed to be updated with the set of L2p table entries, such as oneor more sub-tables that should be updated with the set of L2p tableentries. Additionally, the updating list may comprise at least twopointers respectively corresponding to the aforementioned at least twosame-location L2p table entries, the aforementioned at least twopointers may respectively point toward a same recovery log entry withinthe recovery log, and the same recovery log entry may point toward thesame protected access unit within the table region TR.

FIG. 3 illustrates a plurality of protected access units used in themethod 200 shown in FIG. 2 according to an embodiment of the presentinvention, where examples of the plurality of protected access units maybe protected blocks 310, 320 and 330, but the present invention is notlimited thereto. For example, regarding any protected block within anyof the protected blocks 310, 320 and 330, a symbol “D” may representdata within the protected block, and a symbol “P” may represent a paritycode within the protected block. Through the parity code P, the data Dcan be protected. According to some embodiments, a type and/or aprotection level of the RAID may vary, where user data can be protectedwith a corresponding type and/or level of protection.

FIG. 4 illustrates an L2p table 410 used in the method 200 shown in FIG.2 according to an embodiment of the present invention, and the L2p table410 may be taken as an example of the L2p table mentioned above. The L2ptable 410 may comprise multiple L2p sub-tables, where the first row ofL2p sub-tables may respectively map pages 0-511 (more particularly,logical addresses 0-511) to respective storage locations (e.g. someprotected access units such as protected blocks), and the second row ofL2p sub-tables may respectively map pages 512-1023 (more particularly,logical addresses 512-1023) to respective storage locations (e.g. someprotected access units such as protected blocks), but the presentinvention is not limited thereto. According to some embodiments, thestorage locations may be regarded as ROW locations.

FIG. 5 illustrates an updating list 510 and a recovery log 520 involvedin the method 200 shown in FIG. 2 according to an embodiment of thepresent invention, where auxiliary information {S4, S1021, S1022, S1023,S1, S2, . . . } may be pointers. For brevity, similar descriptions forthis embodiment are not repeated in detail here.

FIG. 6 illustrates an updating list 610 and a recovery log 620 involvedin the method 200 shown in FIG. 2 according to another embodiment of thepresent invention, where auxiliary information {S8, S3, S5, S1, S6, S1,. . . } may be pointers. For example, in Step 230, when the auxiliaryinformation S1 appears twice, the storage system 100 (e.g. theprocessing circuit 111) may detect that the number of the aforementionedat least two same-location L2p table entries (e.g. the two L2p tableentries comprising the auxiliary information S1 shown in FIG. 6) reachesthe predetermined threshold (e.g. 2), and therefore update the L2p tablewith the aforementioned at least two same-location L2p table entries. Asa result, the storage system 100 updates the L2p table ahead of timerather than waiting for the recovery log 620 to become full. Therefore,the present invention apparatus can prevent an overall performance frombeing degraded due to the operations of updating most or all portions ofthe L2p table. The present invention method and apparatus can guaranteethat the storage system is able to normally operate under variousconditions. In addition, the present invention method and apparatusprovide a powerful mapping information managing mechanism, which canachieve various purposes such as optimal performance, high security andbudget control. Additionally, the present invention method and apparatuscan solve the related art problems without introducing any side effector in a way that is less likely to introduce side effects.

Those skilled in the art will readily observe that numerousmodifications and alterations of the device and method may be made whileretaining the teachings of the invention. Accordingly, the abovedisclosure should be construed as limited only by the metes and boundsof the appended claims.

What is claimed is:
 1. A method for performing mapping informationmanagement regarding a redundant array of independent disks (RAID),comprising: writing data into a data region of the RAID in aredirect-on-write (ROW) manner, and recording mapping informationbetween logical addresses of the data and respectiveprotected-access-unit addresses (p-addresses) of protected access unitsin the data region into a logical-address-to-p-address (L2p) tablewithin a table region of the RAID, wherein subsets of the data arewritten into the protected access units, respectively; in response topartial data of the data being updated, maintaining an updating listcomprising a set of L2p table entries for the partial data in a randomaccess memory (RAM), and maintaining a recovery log corresponding to theupdating list in a log region of the RAID, for power failure recovery;and according to the updating list, detecting whether a number of atleast two same-location L2p table entries in the set of L2p tableentries reaches a predetermined threshold, to selectively update the L2ptable with said at least two same-location L2p table entries, whereinsaid at least two same-location L2p table entries represent L2P tableentries within the set of L2P table entries that are supposed to bestored into a same protected access unit within the table region.
 2. Themethod of claim 1, wherein the step of maintaining the updating listcomprising the set of L2p table entries for the partial data in the RAMfurther comprises: in response to the partial data being updated,correspondingly recording auxiliary information in the updating list inorder to detect whether said at least two same-location L2p tableentries exist in the set of L2p table entries.
 3. The method of claim 2,wherein the auxiliary information indicates a set of recovery logentries within the recovery log, and the set of recovery log entriespoint toward a set of protected access units within the table region, toguide the L2p table to be updated according to the set of L2p tableentries.
 4. The method of claim 1, wherein the updating list comprises aset of pointers respectively corresponding to the set of L2p tableentries, the set of pointers respectively point toward a set of recoverylog entries within the recovery log, and the set of recovery log entriespoint toward a set of protected access units within the table region. 5.The method of claim 4, wherein the L2p table comprises at least onesub-table that is supposed to be updated with the set of L2p tableentries; and a location of said at least one sub-table in the tableregion corresponds to the set of protected access units.
 6. The methodof claim 1, wherein the L2p table comprises at least one sub-table thatis supposed to be updated with the set of L2p table entries.
 7. Themethod of claim 1, wherein the updating list comprises at least twopointers respectively corresponding to said at least two same-locationL2p table entries, said at least two pointers respectively point towarda same recovery log entry within the recovery log, and the same recoverylog entry points toward the same protected access unit within the tableregion.
 8. A storage system operating according to the method of claim1, wherein the storage system comprises the RAID.
 9. An apparatus forperforming mapping information management regarding a redundant array ofindependent disks (RAID), comprising: a processing circuit, positionedin a storage system, arranged to control operations of the storagesystem, wherein the operations of the storage system comprise: writingdata into a data region of the RAID in a redirect-on-write (ROW) manner,and recording mapping information between logical addresses of the dataand respective protected-access-unit addresses (p-addresses) ofprotected access units in the data region into alogical-address-to-p-address (L2p) table within a table region of theRAID, wherein subsets of the data are written into the protected accessunits, respectively; in response to partial data of the data beingupdated, maintaining an updating list comprising a set of L2p tableentries for the partial data in a random access memory (RAM), andmaintaining a recovery log corresponding to the updating list in a logregion of the RAID, for power failure recovery; and according to theupdating list, detecting whether a number of at least two same-locationL2p table entries in the set of L2p table entries reaches apredetermined threshold, to selectively update the L2p table with saidat least two same-location L2p table entries, wherein said at least twosame-location L2p table entries represent L2P table entries within theset of L2P table entries that are supposed to be stored into a sameprotected access unit within the table region.